<?php


namespace App\Http\Controllers\Mini;

use App\Http\Controllers\BasicOwnerController;
use App\Http\Controllers\Controller;
use App\Services\BaseService;
use App\Services\PaymentOrderService;
use App\Services\PayMentService;

/**
 * 用户控制器
 * Class UserController
 * @package App\Http\Controllers\Mini
 */
class UserController extends BasicOwnerController
{

    public function my_balance()
    {
        $user = $this->user->one_owner;
            if ($user) {
                $user = $user->toArray();
                $data = [
                    'electric_balance' => $user['electricity_bill_balance'],
                    'water_balance' => $user['water_bill_balance'],
                    'property_balance' => $user['property_bill_balance'],
                ];
            }else {
                $data = [
                    'electric_balance' => 0,
                    'water_balance' => 0,
                    'property_balance' => 0,
                ];
            }

        return $this->success($data, "返回数据");
    }
}
